package com.java.basis.collection;

import org.junit.Test;

import java.util.*;

/**
 * @author wangning
 * @create 2021-10-29 9:41
 */
public class Test01 {

	@Test
	public void test01() {
		List<String> list = new ArrayList<>();
		list.add("a");
		list.add("b");
		list.add("c");
		list.add("d");
		Iterator<String> iterator = list.iterator();
		while (iterator.hasNext()) {
			iterator.next();
		}

		for (String s : list) {
			System.out.println(s);
		}

		//
		List<String> list1 = Collections.synchronizedList(new ArrayList<>());

		Deque<Integer> stack = new ArrayDeque<Integer>();
		stack.isEmpty();
//		stack.add(1);
//		stack.add(2);
//		stack.add(3);
		stack.push(1);
		stack.push(2);
		stack.push(3);

		stack.peek();
		stack.push(4);
		stack.pop();

		System.out.println(stack.peek());


	}
}
